
<template>
  <div>
    <button @click="handleSelect">点我</button>
    <el-menu
      :default-active="$route.path"
      background-color="rgba(0,0,0,0)"
      text-color="#314659"
      active-text-color="#0f8deb"
      unique-opened
      :mode="mode"
      router
    >
      <SubMenu :sub-menu-list="permission_routes" :mode="mode" />
    </el-menu>

  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import SubMenu from './subMenu'

export default {
  components: {
    SubMenu
  },
  data() {
    return {
      activeIndex: '1',
      activeIndex2: '1',
      mode: 'horizontal'
    }
  },
  computed: {
    ...mapGetters([
      'permission_routes',
      'sidebar'
    ])
  },
  methods: {
    handleSelect() {
      console.log(this.permission_routes)
    }
  }
}
</script>

<style >
  .menu1 {
    width: 200px;
    background-color: #42b983;
  }
</style>
